<?php

// 商品表

namespace app\shop\model;

use think\Model;

class ShopGoods extends Model
{

    //商品和店铺多对一
    public function shop()
    {
        return $this->belongsTo('Shop','member_id','member_id')->field('member_id,title');
    }

    // 商铺表 商品关联
    public function ShopGoods()
    {
        return $this->hasMany('ShopGoods', 'member_id', 'member_id')->where('sun_shop_goods.status', 1)
            ->field('id,thumb_img,member_id')->order(['sort' => 'asc'])->limit(4);
    }




}